@isTest
public class scheduledRequestCourierPickupTest
{
    static testMethod void testschedule() 
    {
        //For Previous Implementation...        
        Test.StartTest();
        string result = null;
        //OMM - 15/12/2013 - Service letter
        //Account Object Record...
        Account accountObject2 = new Account();
        accountObject2.Name = 'OMM Test Account';
        accountObject2.License_Application_Step__c = 'Record Created';
        accountObject2.License_Application_Type__c = 'New License';
        accountObject2.Activity__c = 'Trading - One Activity';
        accountObject2.License_Issue_Date__c = system.today();
        accountObject2.License_Expiry_Date__c = System.Today().addYears(1);
        accountObject2.Master_Account_Flag__c = true;
        
        insert accountObject2;
            
        //For Contact Object Records...
        Contact contactObject2 = new Contact();
        contactObject2.LastName = 'OMM Test 1 Manager';
        contactObject2.AccountId = accountObject2.id;
        contactObject2.Current_Employer__c =accountObject2.id;
        contactObject2.Contact_Type__c = 'Manager';
        insert contactObject2;
        
        Map<string,ID> recordTypeNameMap = new Map<string,ID>();
        for(RecordType recordTypeObject : [select id,DeveloperName from RecordType where sObjectType= 'Request__c' AND IsActive = true])
        {
            recordTypeNameMap.put(recordTypeObject.DeveloperName, recordTypeObject.id);
        }
        
        List<Request__c> serviceLetterList = new List<Request__c>();
        Request__c ServiceLetterObject1 = new Request__c();
        ServiceLetterObject1.RecordTypeId  = recordTypeNameMap.get('Amendment') ;
        ServiceLetterObject1.Company__c = accountObject2.id;
        ServiceLetterObject1.Contact__c = contactObject2.id;
        ServiceLetterObject1.Request_Status__c = 'Under Process';
        ServiceLetterObject1.Courier_Delivery_Address__c = 'CEO Building 24 ring Road';
        ServiceLetterObject1.Courier_Delivery_City__c = 'Cairo';
        ServiceLetterObject1.Courier_Delivery_Country__c = 'Egypt';
        ServiceLetterObject1.Courier_Delivery_Contact_Mobile__c = '0120000000' ;
        ServiceLetterObject1.Delivery_Method__c = 'Courier';
        ServiceLetterObject1.Shipment_Number__c = '3605423441';
        ServiceLetterObject1.Shipment_Status__c = 'Not Exists';
        ServiceLetterObject1.Request_Status__c='Scheduled for Delivery';
        
        insert ServiceLetterObject1;
        result = buttonExecutionClass.serviceLetterApproveButton(ServiceLetterObject1.Id);
        result = buttonExecutionClass.serviceLetterConfirmLetterSignedButton(ServiceLetterObject1.Id);
        result = buttonExecutionClass.serviceLetterRefreshCourierstatusButton(ServiceLetterObject1.Id);
        
        Request__c ServiceLetterObject2 = new Request__c();
        ServiceLetterObject2.RecordTypeId  = recordTypeNameMap.get('Certificate') ;
        ServiceLetterObject2.Company__c = accountObject2.id;
        ServiceLetterObject2.Contact__c = contactObject2.id;
        ServiceLetterObject2.Request_Status__c = 'Under Process';
        ServiceLetterObject2.Courier_Delivery_Address__c = 'CEO Building 24 ring Road';
        ServiceLetterObject2.Courier_Delivery_City__c = 'Cairo';
        ServiceLetterObject2.Courier_Delivery_Country__c = 'Egypt';
        ServiceLetterObject2.Courier_Delivery_Contact_Mobile__c = '0120000000' ;
        ServiceLetterObject2.Delivery_Method__c = 'Courier';
        ServiceLetterObject2.Shipment_Status__c = 'Not Exists';
        ServiceLetterObject2.Request_Status__c='Scheduled for Delivery';
        
        insert ServiceLetterObject2 ;
        result = buttonExecutionClass.serviceLetterApproveButton(ServiceLetterObject2.Id);
        result = buttonExecutionClass.serviceLetterConfirmLetterSignedButton(ServiceLetterObject2.Id);
        result = buttonExecutionClass.serviceLetterRefreshCourierstatusButton(ServiceLetterObject2.Id);
        
        scheduledRequestCourierPickup bs = new scheduledRequestCourierPickup();
        scheduledVerifyCourierPickup bs1 = new scheduledVerifyCourierPickup();
        //system.schedule('Test',sch,bs);
        Test.stopTest();
    }
}